﻿<%@ page language="C#" autoeventwireup="true" inherits="list_cat, App_Web_uiix6fmb" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>信息类别</title>
    <link href="../../skin/default/main.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        var bgover="background-color:#f5f5dc;cursor:hand;color:#003399;";
        var bgout="background-color:#ffffff;color:#003399;";        
        
        function onoverRow()
        {
            event.srcElement.parentNode.style.cssText=bgover;
        }
        
        function onoutRow()
        {
            event.srcElement.parentNode.style.cssText=bgout;
        }
        
        function checkUser()
        {
            var catName,parCat,menu,sort            
            catName=document.getElementById("tbCat").value;
            parCat=document.getElementById("ddlCat").value;        
            
            if(catName=="")
            {
                alert("类别名称不能为空！");
                return false;
            }
            if(parCat=="")
            {
                alert("还没选择上一级类别！");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lbLocation" runat="server" Text="当前位置：信息类别" Font-Size="Large" Font-Bold="True"></asp:Label>
        <asp:ScriptManager id="sm" runat="server"></asp:ScriptManager>
        <asp:Panel ID="pnlUser" runat="server" BackColor="White" Width="99%" BorderStyle="Dotted" BorderWidth="1px">                
            <asp:UpdatePanel ID="upUser" runat="server">
                <ContentTemplate>
                <table width="100%">
                    <tr><td colspan="2" style="background-color:Blue;">
                        <asp:Label ID="lblTlt" runat="server" Text="添加或修改信息类别" Font-Bold="True" ForeColor="White"></asp:Label>
                    </td></tr>
                    <tr><td>
                        <asp:HiddenField ID="hfId" runat="server" />
                        类别名称：<asp:TextBox ID="tbCat" runat="server"></asp:TextBox></td><td>
                            上一级类别：<asp:DropDownList ID="ddlCat" runat="server">
                        </asp:DropDownList></td></tr>
                    <tr><td>
                        类别说明：<asp:TextBox ID="tbCont" runat="server"></asp:TextBox></td><td>
                        &nbsp;作为导航菜单：<asp:CheckBox ID="CkbMenu" runat="server" Checked="True" Text="显示" OnCheckedChanged="CkbMenu_CheckedChanged" AutoPostBack="True" /></td></tr>                 
                    <tr><td>
                        <asp:Label ID="lbSort" runat="server" Text="显示顺序："></asp:Label><asp:TextBox ID="tbSort" runat="server"></asp:TextBox></td><td style="height: 26px">
                            <asp:Button ID="btnSbt" runat="server" Text="保存" OnClientClick="return checkUser()" OnClick="btnSbt_Click" />
                            <asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_Click" Text="取消" /></td></tr>            
                </table>
                </ContentTemplate>                
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="gv" EventName="RowEditing" />
                    <asp:AsyncPostBackTrigger ControlID="btnSbt" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            &nbsp;
        </asp:Panel>
        
        <asp:Panel ID="pnlSearch" runat="server" BackColor="#FFFFC0" Width="99%" BorderColor="#FFFFC0" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Right">
            <asp:TextBox ID="tbSearch" runat="server"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" /></asp:Panel>
            
        <asp:Panel ID="pnlData" runat="server" Width="99%">
        <asp:UpdatePanel id="up" runat="server">
            <contenttemplate><asp:GridView
            ID="gv" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC"
            BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="catID" OnRowDeleting="gvMain_RowDeleting" OnRowDataBound="gvMain_RowDataBound" Width="100%" AllowPaging="True" OnRowEditing="gv_RowEditing" OnPageIndexChanging="gv_PageIndexChanging">
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <EmptyDataTemplate>
                <div align="center" style="color:Red;">没有相关记录</div>
            </EmptyDataTemplate>
            <Columns>
                <asp:BoundField DataField="catID" HeaderText="编号" />
                <asp:BoundField DataField="catName" HeaderText="类别名称" />
                <asp:BoundField DataField="catCont" HeaderText="类别说明" />
                <asp:BoundField DataField="parCat" HeaderText="parCat" />
                <asp:BoundField DataField="parCatName" HeaderText="上一级类别" />
                <asp:BoundField DataField="menuable" HeaderText="作为导航菜单" />
                <asp:BoundField DataField="catOrder" HeaderText="显示顺序" />
                <asp:CommandField ShowEditButton="True" ButtonType="Image" EditImageUrl="~/skin/default/images/edit.gif" />
                <asp:CommandField ShowDeleteButton="True" ButtonType="Image" DeleteImageUrl="~/skin/default/images/delete.gif" />
            </Columns>
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Right" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                <PagerSettings Mode="NextPreviousFirstLast" Position="TopAndBottom" FirstPageText="&amp;lt;&amp;lt;第一页" LastPageText="&amp;gt;&amp;gt;最后一页" NextPageText="&amp;gt;下一页" PreviousPageText="&amp;lt;上一页" />
        </asp:GridView></contenttemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnSbt" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
